import VueRouter from 'vue-router'

import home     from './components/tabbar/HomeContainer.vue'
import member   from './components/tabbar/MemberContainer.vue'
import shopcar  from './components/tabbar/ShopcarContainer.vue'
import search   from './components/tabbar/SearchContainer.vue'


import news     from './components/news/news.vue'
import newsinfo from './components/news/newsinfo.vue'

import photolist from './components/photos/photolist.vue'
import photoinfo from './components/photos/photoinfo.vue'

import goodslist from './components/goods/goodslist.vue'
import goodsinfo from './components/goods/goodsinfo.vue'
import goodsdesc from './components/goods/goodsdesc.vue'
import goodscomment from './components/goods/goodscomment.vue'


// 路由配置
var router = new VueRouter({
    routes: [
        { path: '/',        redirect: '/home' },
        { path: '/home',    component: home,
            // children: [
            //     { path: "news", component: news }
            // ]
        }, // 主页
        { path: '/member',  component: member },    // 会员
        { path: '/shopcar', component: shopcar },   // 购物车
        { path: '/search',  component: search },    // 搜索

        { path: '/home/news', component: news },    // 新闻资讯
        { path: '/home/newsinfo/:id', component: newsinfo },    // 新闻细节

        { path: '/home/photolist', component: photolist },  // 照片分享
        { path: '/home/photoinfo/:id', component: photoinfo },  // 照片详情

        { path: '/home/goodslist', component: goodslist },  // 商品列表
        { path: '/home/goodsinfo/:id', component: goodsinfo, name: "goodsinfo" },  // 商品详情
        { path: '/home/goodsdesc/:id', component: goodsdesc, name: "goodsdesc" },   // 图文介绍
        { path: '/home/goodscomment/:id', component: goodscomment, name: "goodscomment" },   // 商品评论

        
    ],
    linkActiveClass: 'mui-active'   // 配置默认高亮类，默认为'router-link-active'
})


// 把路由导出去
export default router;